package com.workspace.chb_website.mapper;

import com.workspace.chb_website.bean.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Mapper
@Repository("userMapper")
public interface UserMapper {
    @Select("select * from users where username = #{username}")
    User loadUserByUsername(String username);

    @Update("Update users set password = #{newPassword} where user_id = #{userId}")
    void updatePassword(String userId, String newPassword);
}
